import request from "@/utils/request"

// 新增顶级组织
export function addOrg(data) {
  return request({
    url: `/sysOrgManager`,
    method: "post",
    data
  })
}

// 修改组织
export function updateOrgApi(data) {
  return request({
    url: `/sysOrgManager`,
    method: "put",
    data
  })
}

// 删除组织
export function deleteOrg(id) {
  return request({
    url: `/sysOrgManager/${id}`,
    method: "delete",
  })
}

// 组织详情
export function queryOrgDetail(id) {
  return request({
    url: `/sysOrgManager/${id}`,
    method: "get",
  })
}

// 组织树形
export function findTree() {
  return request({
    url: `/base/orgDict/findAll`,
    method: "get",
  })
}

/** 增 */
export function createTableDataApi(data) {
  return request({
    url: "table",
    method: "post",
    data
  })
}

/** 删 */
export function deleteTableDataApi(id) {
  return request({
    url: `table/${id}`,
    method: "delete"
  })
}

/** 改 */
export function updateTableDataApi(data) {
  return request({
    url: "table",
    method: "put",
    data
  })
}

/** 查 */
export function queryOrganization(params) {
  return request({
    url: "/queryOrganization",
    method: "get",
    params
  })
}
